#ifdef GL_ES
precision highp float;
#endif

varying vec3 vNor;
varying vec3 vPos;

uniform int uuseColor;

void main(void) {

    if(uuseColor < 1) {
        gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
    }
    else {
        //Static, white directional light
        vec3 lDir = normalize(vec3(1.0, 2.0, 3.0));

        //Static material color
        vec4 mAmbient   = vec4(0.3,0.3,0.3,1.0);
        vec4 mDiffuse   = vec4(0.8,0.8,0.8,1.0);

        gl_FragColor = mAmbient * mDiffuse + mDiffuse * max(0.0, dot(lDir, vNor));
    }
}